package com.maidada.mddaichat.exception;

import com.maidada.mddaichat.common.ErrorCode;
import lombok.Getter;

/**
 * @author: wulinxuan
 * @date: 2024/12/17 22:55
 */
@Getter
public class BusinessException extends RuntimeException {

    private final int code;

    public BusinessException(ErrorCode errorCode) {
        super(errorCode.getMsg());
        this.code = errorCode.getCode();
    }

    public BusinessException(ErrorCode errorCode, String msg) {
        super(msg);
        this.code = errorCode.getCode();
    }
}
